package com.winkyle.woodenfish.retrofit;

import com.squareup.okhttp.RequestBody;
import com.winkyle.woodenfish.entity.HttpResult;
import com.winkyle.woodenfish.entity.UserInfo;

import retrofit.http.GET;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.PUT;
import retrofit.http.Part;
import retrofit.http.Query;
import rx.Observable;

/**
 * @author winkyle
 * @date 2018/06/19
 * @description UserInfo的网络数据访问接口类
 */

public interface UserInfoRetrofit {
    @POST(Apis.LOGIN)
    Observable<HttpResult> findLoginResult(@Query("deviceNumber")String deviceNumber, @Query("account") String account, @Query("password")String password, @Query("loginFrom") String loginFrom);

    @GET(Apis.USER_INFO_BY_USER_ID)
    Observable<HttpResult<UserInfo>> findUserInfoByUserId();

    @Multipart
    @PUT(Apis.HEAD_PORTRAIT_BY_USER_ID)
    Observable<HttpResult<String>> modifyHeadPortraitByUserId(@Part("headPortrait\";filename=\"mine.jpg")RequestBody headPortrait);
}